Avorion Script API Documentation

Alliance [Client]

This object is only available on the client.

function Alliance()

Returns

A new instance of Alliance

property string fullLogId[read-only]
property int index[read-only]
property bool infiniteResources
property bool isAIFaction[read-only]
property bool isAlliance[read-only]
property bool isPlayer[read-only]
property int maxNumShips[read-only]
property int maxNumStations[read-only]
property int money[read-only]
property string name[read-only]
property unsigned int numShips[read-only]

function var addRank(string name, string lowerName)

Returns

nothing

function var addRankPrivilege(string rank, int privilege)

Returns

nothing

function int callbacksRegistered(string callbackName, var functionName)

Check how many functions are registered to a callback from the current script VM.

Parameters

callbackName The name of the callback
functionName The name of the function for which to check. If nil, will count all functions that are registered to this callback.

Returns

The amount of functions registered to the callback

function bool, string, table<int, string> canPay()

function bool contains(int playerIndex)

function Relation... getAllRelations()

function int, int getHomeSectorCoordinates()

function Inventory getInventory()

function SectorView getKnownSector(int x, int y)

function ivec2... getKnownSectorCoordinates()

function SectorView... getKnownSectors()

function SectorView... getKnownSectorsOfFaction(int factionIndex)

function SectorView... getKnownSectorsWithFaction(int factionIndex)

function int, int getMemberLocation(int playerIndex)

function AllianceRank getMemberRank(int playerIndex)

function string... getNamesOfShipsInSector(int x, int y)

function PlanStyle getPlanStyle(string name)

function string... getPlanStyleNames()

function AllianceRank getRank(string name)

function Relation getRelation(int factionIndex)

function int getRelations(int factionIndex)

function int getRelationStatus(int factionIndex)

function Resources getResources()

function ShipAvailability getShipAvailability(string name)

function Box getShipBoundingBox(string name)

function bool getShipCanPassRifts(string name)

function CargoBay getShipCargo(string name)

function table<TradingGood, int> getShipCargos(string name)

function bool getShipDestroyed(string name)

function float getShipHyperspaceReach(string name)

function string getShipIcon(string name)

function string... getShipNames()

function string getShipOrderInfo(string name)

function float getShipPayment(string name)

function float getShipPaymentTime(string name)

function BlockPlan getShipPlan(string name)

function Coordinates getShipPosition(string name)

function double getShipReconstructionValue(string name)

function string getShipStatus(string name)

function ShipInfoUpgrade... getShipSystems(string name)

function table<int, TurretDesign> getShipTurretDesigns(string name)

function int getShipType(string name)

function bool hasPrivilege(int playerIndex, int privilege)

function var... invokeFunction(var scriptName, string functionName, var... arguments)

Invokes a function in a script of the alliance. Use this function to invoke functions from one script in another script. The first return value of the function is an integer indicating whether or not the call was successful. When it was, this integer is followed by the return values of the invoked function.

Parameters

scriptName The name of the script containing the function
functionName The name of the function that will be executed
arguments An arbitrary list of arguments that will be given to the invoked function. Only numbers, std::strings and nil are supported here.

Returns

Returns at least 1 value indicating if the call succeeded:
0 The call was successful. In this case, the return values of the script are returned in addition to the call result, following the call result.
3 The call failed because the given script was not found in the alliance.
4 The call failed because the given function was not found in the script.
5 The call failed because the script's state has errors and is invalid

function bool knowsFaction(int factionIndex)

function bool knowsSector(int x, int y)

function var moveRank(string name, string lowerName)

Returns

nothing

function bool ownsShip(string name)

function bool rankExists(string rank)

function var registerCallback(string callbackName, string functionName)

Register a callback in the alliance. The callback will be removed when the sector is changed or the receiver, if it's an entity, is destroyed. Double registration of callbacks doesn't work. When the same callback to the same callback of the same script instance is registered twice, it will still only be called once.

Parameters

callbackName The name of the callback
functionName The name of the function that will be executed in the script when the callback happens

Returns

nothing

function var removeRank(string name)

Returns

nothing

function var removeRankPrivilege(string rankName, int privilege)

Returns

nothing

function var sendCallback()

Returns

nothing

function var setMemberRank(int playerIndex, string rank)

Returns

nothing

function var unregisterCallback(string , string )

Returns

nothing

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7